webpackJsonp([41],{

/***/ "0Cz3":
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ "hdI+":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/regenerator/index.js
var regenerator = __webpack_require__("lC5x");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("J0Oq");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);

// EXTERNAL MODULE: ./src/store/index.js
var store = __webpack_require__("IcnI");

// EXTERNAL MODULE: ./src/common/api/commonApi.js
var commonApi = __webpack_require__("+/+p");

// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=script&index=0!./src/common/anjian/base/modifyPwd.vue


//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//




/* harmony default export */ var modifyPwd = ({
  name: 'modifyPwd',
  data: function data() {
    var _this = this;

    return {
      form: {
        password: '',
        newPassword: '',
        confirmPassword: ''
      },
      rules: {
        password: { type: 'string', required: true, message: '原始密码不能为空!' },
        newPassword: { type: 'string', required: true, message: '新密码不能为空!' },
        confirmPassword: [{ type: 'string', required: true, message: '确定密码不能为空!' }, {
          validator: function validator(rule, value, callback) {
            if (_this.form.newPassword === _this.form.confirmPassword) {
              callback();
            } else {
              callback(new Error('两次密码不一致，请重新输入'));
            }
          }
        }]
      }
    };
  },

  methods: {
    doConfirm: function doConfirm(loaded) {
      var _this2 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
        var user;
        return regenerator_default.a.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                _context.prev = 0;
                _context.next = 3;
                return commonApi["a" /* commonApi */].login({ username: Object(store["c" /* GetStore */])(store["f" /* Store */].user).username, password: _this2.form.password });

              case 3:
                user = _context.sent;

                user.setPassword(_this2.form.newPassword);
                _context.next = 7;
                return user.save();

              case 7:
                _this2.$Toast('修改密码成功！');
                _this2.$router.$back();
                _context.next = 14;
                break;

              case 11:
                _context.prev = 11;
                _context.t0 = _context['catch'](0);

                _this2.$Toast('修改密码失败！', 'error');

              case 14:
                loaded();

              case 15:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, _this2, [[0, 11]]);
      }))();
    }
  }
});
// CONCATENATED MODULE: ./node_modules/_vue-loader@13.7.3@vue-loader/lib/template-compiler?{"id":"data-v-5e424932","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=template&index=0!./src/common/anjian/base/modifyPwd.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('yt-page',{attrs:{"title":"修改密码","theme":"white"}},[_c('yt-form',{staticClass:"form",attrs:{"model":_vm.form,"rules":_vm.rules,"full":false}},[_c('div',{staticClass:"box"},[_c('yt-input',{staticClass:"input",attrs:{"type":"password","placeholder":"请输入原始密码","align":"left","border":""},model:{value:(_vm.form.password),callback:function ($$v) {_vm.$set(_vm.form, "password", $$v)},expression:"form.password"}})],1),_vm._v(" "),_c('div',{staticClass:"box"},[_c('yt-input',{staticClass:"input",attrs:{"type":"password","placeholder":"请输入新密码","align":"left","border":""},model:{value:(_vm.form.newPassword),callback:function ($$v) {_vm.$set(_vm.form, "newPassword", $$v)},expression:"form.newPassword"}})],1),_vm._v(" "),_c('div',{staticClass:"box"},[_c('yt-input',{staticClass:"input",attrs:{"type":"password","placeholder":"请输入确定密码","align":"left","border":""},model:{value:(_vm.form.confirmPassword),callback:function ($$v) {_vm.$set(_vm.form, "confirmPassword", $$v)},expression:"form.confirmPassword"}})],1),_vm._v(" "),_c('yt-btn',{staticClass:"btn",attrs:{"theme":"black","validator":"","loading":_vm.doConfirm}},[_vm._v("确定")])],1)],1)}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var base_modifyPwd = (esExports);
// CONCATENATED MODULE: ./src/common/anjian/base/modifyPwd.vue
function injectStyle (ssrContext) {
  __webpack_require__("0Cz3")
}
var normalizeComponent = __webpack_require__("C7Lr")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-5e424932"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  modifyPwd,
  base_modifyPwd,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var anjian_base_modifyPwd = __webpack_exports__["default"] = (Component.exports);


/***/ })

});